<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            width: 100%;
            height: 100%;

        }

        button {
            margin: 20px 100px;
            padding: 10px 20px;

        }
    </style>
</head>

<body>
    <button class="btn">点击更换BOOY皮肤(白->红->绿->蓝->黑->白)</button>
    <script>
        var body = document.body;
        var color = ['white', 'red', 'green', 'blue', 'black',]
        var btn = document.querySelector('button')
        var index = 0
        body.style.backgroundColor = color[index]
        btn.onclick = function () {
            index++
            if (color.length == index) {
                index = 0
            }
            body.style.backgroundColor = color[index]

        }
    </script>
</body>

</html>